package com.agenda.server.recebedores;

import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.Socket;
import com.agenda.comum.ObjectRecebedorInformacao;
import com.agenda.controller.UsuarioController;
import com.agenda.model.RespostaRequisicao;

public class RetornarUsuariosRecebedor extends ObjectRecebedorInformacao {

	@Override
	public void receber(Socket sck) throws Exception {
		this.sck = sck;
		resposta = new RespostaRequisicao(false, "");
	}

	@Override
	public void receber(ObjectInputStream objectInput) throws Exception {

	}

	@Override
	protected void responder(OutputStream outputStream) throws Exception {
		ObjectOutputStream objOutput = new ObjectOutputStream(sck.getOutputStream());
		objOutput.writeObject(UsuarioController.getInstancia().getRegistros());
	}

}
